package com.joysuch.wwyt.mh.enums;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

public enum PlanLoopType {
    LOOP(0,"循环"),
    SINGLE(1,"单次");

    private Integer type;
    private String desc;

    PlanLoopType(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    private static final Map<Integer, PlanLoopType> lookup = new HashMap<>();

    static {
        for (PlanLoopType e : EnumSet.allOf(PlanLoopType.class)) {
            lookup.put(e.type, e);
        }
    }

    public static PlanLoopType find(Integer type) {
        return lookup.get(type);
    }
}
